package erfgame.core.world.generator.terrain;

public class FlatTerrainBlockGenerator implements TerrainBlockGenerator {

	private byte type;
	
	public FlatTerrainBlockGenerator( byte type ) {
		this.type = type;
	}
	
	public boolean generate(int bx, int by, int bz, int bw, int bh, int bd, byte[][][] terrain) {
		// fill the block from 0, 0, 0 to the bottom
		for( int x=0; x<bw; x++ )  {
			for( int y=0; y<bh; y++ ) {
//				int zstart = (y * bd)/bh;
				int zstart = y;
				for( int z=zstart; z<bd; z++ ) {
					terrain[x][y][z] = type;
				}
			}
		}
		return true;
	}

}
